/*
 * PGcourse.cpp
 *
 *  Created on: Nov 13, 2012
 *      Author: monitz
 */

using namespace std;
#include <iostream>
#include <stdlib.h>
#include "../include/PGCourse.h"

PGCourse::PGCourse() {
	semester=1;
		minimumGrade=0;
		regStudents = new List();
		name = "";
}
PGCourse::PGCourse(string Cname, int grade, int Csemester) {
	semester=Csemester;
	minimumGrade=grade;
	regStudents = new List();
	name = Cname;
}

void PGCourse::reg(Student &s) {
//==typeid(CSStudent)
	if (typeid(s)==typeid(CSSstudent) && s.GetSemester() == semester) {
		regStudents->insertData(s);
	}
}
void PGCourse::teach()
{
Link* tmp = regStudents->getHead();
while (tmp != 0) {

	tmp->getData().study(this);
	tmp = tmp->getNext();
}
}
PGCourse::~PGCourse() {
	delete regStudents;
}

